package com.example.admin.controller.web.email;

import com.example.common.core.response.AjaxResult;
import com.example.common.email.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈建峰
 * @date 2022/11/2 14:37
 * @Description
 */
@RestController
@RequestMapping("/email")
public class EmailController {

    @Autowired
    private EmailService emailService;

    @PostMapping("/send")
    public AjaxResult sendEamil(String to, String subject, String context) {
        emailService.sendMail(to, subject, context);
        return AjaxResult.success();
    }

}
